<?php
namespace app\home\model;


  use think\Model;

  class User extends Model
  {
      protected $pk = 'id';

      public function adduser($arr)
      {

          if($arr['pass'] == $arr['repass']){

              unset($arr['repass']);
              $arr['pass']=md5(md5($arr['pass']));

              $row =  $this->save($arr);
              return $row;
          }

          return false;
      }

      public function checkLogin($arr)
      {
          $result = User::get(['tel'=>$arr['tel'],'pass'=>md5(md5($arr['pass']))]);
          if($result){
              return $result->data;
          }else{
              return false;
          }
      }

  }